<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>大小盒子切换</title>
		<style type="text/css">
			div{
				cursor:pointer;
				border: solid 1px red;
			}
		</style>
		
	</head>
	<body>
		<div class="icon_keifu" id="div">小盒子</div>
		<div class="keifu_box" id="div" style="width: 300px; height: 120px;">大盒子</div>
	</body>
</html>
<script type="text/javascript">
//		window.onload = function(){ 
			var icon_keifu =document.getElementsByClassName("icon_keifu");
			var keifu_box =document.getElementsByClassName("keifu_box");
    		keifu_box[0].onclick = function () {
    			keifu_box[0].style.display="none";
    			icon_keifu[0].style.display="block";
       		}
    		icon_keifu[0].onclick = function () {
    			icon_keifu[0].style.display="none";
    			keifu_box[0].style.display="block";
       		}
    		
//  	}
</script>
